<template>
  <div>
    <h1>用户列表</h1>
    <div>
      <el-table :data="tableData">
        <el-table-column prop="_id" label="ID" width="260">
        </el-table-column>
        <el-table-column prop="name" label="用户名" width="120">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    index:String
  },
  name: 'AdminUserList',
  data () {
    return {
      tableData: []
    }
  },
  created () {
    this.fetch()
  },
  methods: {
    async fetch () {
      const result = await this.$http.get('/rest/admin_users')
      if(result.data){
         this.tableData = result.data
      }
    }
  }
}
</script>
